﻿using System;
using System.Collections.Generic;
using System.Linq;
using System.Threading.Tasks;
using CNFM_CROCODILE_LOGO.Services.Interfaces;
using Microsoft.AspNetCore.Mvc;

namespace CNFM_CROCODILE_LOGO_Web.Controllers
{
    /// <summary>
    /// 区域管理
    /// </summary>
    public class AreaController : Controller
    {
        private IBasicServices _pro;
        public AreaController(IBasicServices pro)
        {
            this._pro = pro;
        }


        /// <summary>
        /// 区域列表
        /// </summary>
        /// <returns></returns>
        public IActionResult List()
        {
            return View();
        }

        public IActionResult AreaDailyList()
        {
            return View();
        }

        /// <summary>
        /// 地区列表
        /// </summary>
        /// <param name="code"></param>
        /// <returns></returns>
        public JsonResult GetAreaAll(string code)
        {
            var ret = _pro.GetAreaAll(code);
            return Json(ret);
        }

        /// <summary>
        /// 省市区联动
        /// </summary>
        /// <param name="lev"></param>
        /// <param name="name"></param>
        /// <returns></returns>
        public JsonResult GetAreaSelectAll(int lev, string name)
        {
            var ret = _pro.GetAreaSelectAll(lev, name);
            return Json(ret);
        }
    }
}